From 0aa60127f718cca709f4bedab9c2e48e67d3889e Mon Sep 17 00:00:00 2001 From: robertlipe Date: Tue, 28 Jan 2014 05:38:31 +0000 Subject: [PATCH] A variety of (non-code) changes that teach docbook generation more about Smarty and less about DreamWeaver. Adobe is dead to me. --- gpsbabel/Makefile.in | 5 ++++ gpsbabel/tools/fixdoc | 39 ++++++++++++++++++++++++++ gpsbabel/xmldoc/babelmain.xsl | 52 ++++++++++++++++++++++++++++------- 3 files changed, 86 insertions(+), 10 deletions(-) create mode 100755 gpsbabel/tools/fixdoc diff --git a/gpsbabel/Makefile.in b/gpsbabel/Makefile.in index a94e57283..f88145306 100644 --- a/gpsbabel/Makefile.in +++ b/gpsbabel/Makefile.in @@ -229,6 +229,7 @@ $(WEB)/htmldoc-$(DOCVERSION)/index.html: FORCE --stringparam root.filename "index" \ xmldoc/babelmain.xsl \ xmldoc/readme.xml + tools/fixdoc $(WEB)/htmldoc-$(DOCVERSION) "GPSBabel $(DOCVERSION):" chmod 755 tools/mkcapabilities tools/mkcapabilities @@ -263,6 +264,10 @@ gpsbabel.html: FORCE # gpsbabel xsltproc \ --output $@ \ --stringparam toc.section.depth "1" \ + --stringparam html.cleanup "1" \ + --stringparam make.clean.html "1" \ + --stringparam html.valid.html "1" \ + --stringparam html.stylesheet \ --stringparam html.stylesheet \ "http://www.gpsbabel.org/style3.css" \ http://docbook.sourceforge.net/release/xsl/current/xhtml/docbook.xsl \ diff --git a/gpsbabel/tools/fixdoc b/gpsbabel/tools/fixdoc new file mode 100755 index 000000000..9bd404ec8 --- /dev/null +++ b/gpsbabel/tools/fixdoc @@ -0,0 +1,39 @@ +#/bin/sh + +# set -e + +# for the customizations that I'm tired of fighting babelmain.xsl to get +# docbook to produce HTML that plays nice with Smarty. +# This tries to codify a bunch of manual and automated fixes that were needed +# before to bludgeon our docbook output into Dreamweaver's terrible templating +# system. + +DIR=$1 +TITLE=$2 + +SED=sed +[ -f /opt/local/bin/gsed ] && SED=/opt/local/bin/gsed + +[ ! -d $DIR/tpl ] && mkdir -p $DIR/tpl + + +for f in $DIR/*.html +do + base=$(echo $f | sed "s/.html$//") + $SED -i \ + -e '/^#{block name=title}${TITLE}#" \ + -e 's#<\/title>.*#{/block}#' \ + -e '/^ ${base}.html << EOF +display(\$template); +?> +EOF + +done diff --git a/gpsbabel/xmldoc/babelmain.xsl b/gpsbabel/xmldoc/babelmain.xsl index 132c2f9e0..f70dd8255 100644 --- a/gpsbabel/xmldoc/babelmain.xsl +++ b/gpsbabel/xmldoc/babelmain.xsl @@ -13,9 +13,6 @@ - InstanceBegin template="/Templates/primarypage.dwt" codeOutsideHTMLisLocked="false" - -